<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--使用JSTL标签--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
<head>
    <title>全部博客</title>
    <%--引用BootStarp--%>
    <link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <style>
        body{background: linear-gradient(#b3e6ea, #ffffff);}
    </style>
</head>
<body>


<div class="container">

    <%--标题--%>
    <div class="row clearfix">
        <div class="col-md-12 column">
            <div class="page-header">
                <h1>
                    <small>博客列表--显示所有博客</small>
                </h1>
            </div>
        </div>
    </div>

    <%--增加--%>
    <div class="row">
        <div class="col-md-4 column">
            <a class="btn btn-primary" href="${pageContext.request.contextPath}/writeBlog">新增</a>
        </div>
    </div>

    <%--展示页面：表格，修改，删除--%>
    <div class="row clearfix">
        <div class="col-md-12 column">
            <table class="table table-hover table-striped">
                <%--表头--%>
                <thead>
                <tr>
                    <th>博客名称</th>
                    <th>作者</th>
                    <th>发布时间</th>
                    <th>点击数量</th>
                    <%--操作：修改，删除--%>
                    <th>点赞数量</th>
                </tr>
                </thead>
                <%--表的内容--%>
                <tbody>
                <c:forEach var="blogs" items="${blogs}">
                    <tr>
<%--                        <td onclick=console.log('${blogs.blogName}')>${blogs.blogName}</td>--%>
                        <td onclick=location.href='/blog/getBlog/${blogs.userName}/${blogs.blogName}'>${blogs.blogName}</td>
                        <td>${blogs.userName}</td>
                        <td>${blogs.releaseTime}</td>
                        <td>${blogs.clickTime}</td>
                        <td>${blogs.likeTime}</td>
<%--                        <td>--%>
<%--                            <a href="${pageContext.request.contextPath}/book/toUpdateBook?id=${book.getBookID()}">更改</a> |--%>
<%--                            <a href="${pageContext.request.contextPath}/book/del/${book.getBookID()}">删除</a>--%>
<%--                        </td>--%>
                    </tr>
                </c:forEach>

                </tbody>

            </table>
        </div>
    </div>





</div>


</body>
</html>